Skip to content

fix(web): Esc in the Files search clears it without closing the sheet - #41616

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-files-search-escape-sheet
Nov 23, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-files-search-escape-sheet

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

On narrow windows the right panel opens as a sheet. Pressing Esc in the Files search cleared the query and also closed the whole Files sheet, because the Escape bubbled up to the sheet's dismiss handler. Esc pressed to cancel an IME candidate also cleared the whole query.

The search field now ignores Escape while an IME composition is active, and stops the Escape from bubbling when it clears a non-empty query. Esc on an empty search still closes the sheet, as before. This matches the keybindings search fix in #35161. The field is now a text input with the searchbox role, because a native search input clears itself on Escape even during IME composition (the same change as #28298).

The new browser test renders the panel inside the real RightPanelSheet. It fails on main and passes with this change.

Before and after

Setup: Linux, Chromium (T3 Browser panel), light theme, 720×800 viewport, fresh isolated dev data (--no-seed) with a small synthetic project on each commit.

Steps: open the Files panel → type readme in the file search → press Esc

7f0e736 (main) 5d9c9af (this PR)
Esc closes the whole Files sheet Esc clears the search and the Files sheet stays open
Esc closes the whole Files sheet Esc clears the search and the Files sheet stays open
The query typed, before Esc (same on both commits)
7f0e736 (main) 5d9c9af (this PR)
Search shows readme, Files sheet open Search shows readme, Files sheet open

An AI agent (Claude Opus 5.5, T3 Code) also checked that Esc on an empty search still closes the sheet, and that at 1400px wide (inline panel) Esc still clears and blurs the search. Not shown: the IME case, which the browser test covers.

Generated with Claude Opus 5.5 in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5d9c9af and e09bab8.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The file search input now preserves its query during IME composition. Ordinary Escape clears a nonempty query before a subsequent Escape closes the sheet. A browser test covers this behavior.

Changes: File search Escape handling

Layer / File(s) Summary
Search Escape behavior
apps/web/src/components/files/FileBrowserPanel.tsx, apps/web/src/components/files/FileBrowserPanel.browser.test.tsx
The search input uses type="text" with a searchbox role. Escape during IME composition does not alter the query. An ordinary Escape clears a nonempty query without closing the sheet; a later Escape closes it. The browser test verifies these interactions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: mikeozornin, jieyuexing, juliusmarminge

Merge Risk: Minimal · previous review 5d9c9

This change makes Escape in the Files search clear the query without closing the sheet, and it ignores Escape during IME composition. The scope is a narrow UI interaction, and no concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Escape in the Files search now clears the query without closing the sheet. It uses a conventional commit prefix and plain language. It matches the raw summary and the …
Description check Passed The description follows the template well. It states the problem with expected behavior and reproduction steps (Linux, Chromium, 720x800, steps listed). It explains the change (IME-aware Escape handli…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Escape in the Files search now clears the query without closing the sheet. It uses a conventional commit prefix and plain language. It matches the raw summary and the PR objectives, which describe Escape handling in FileSearchField and the new browser test.

Full details: Description check

Explanation

The description follows the template well. It states the problem with expected behavior and reproduction steps (Linux, Chromium, 720x800, steps listed). It explains the change (IME-aware Escape handling, stopPropagation on non-empty clear, searchbox text input). It gives verification: a new browser test that fails on main and passes with the change, plus before/after screenshots and a manual check of empty-search and 1400px cases. It names the model and harness. The Scope section is weak: it does not link an issue that shows the bug. It cites PR #35161 and #28298 as related, but these are not the bug report. The author should state whether an issue exists or explain why none is needed, and should link any maintainer request.

Resolution

Optionally add an issue link under Scope, or state why no issue is needed for this small bug fix. The description is otherwise complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 732c712 and 5d9c9af.

Files selected for processing: 2

  • apps/web/src/components/files/FileBrowserPanel.browser.test.tsx
  • apps/web/src/components/files/FileBrowserPanel.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 23, 2026
…escape-sheet

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Real web app, Chromium, 900×750, dark theme, fresh synthetic state on each commit. Open a thread → Toggle right panel → Files → enter readme in the focused search → press Escape once.

Before After
9b8ab94b24 e09bab8748
Sheet closes; composer receives focus. Search clears; sheet stays open.
Before: Escape dismisses Files sheet After: Escape clears search with Files sheet still open
Before recording After recording

On the fix, a second Escape from the focused empty search still dismisses the sheet. scenarios:prove exited 0: failed on base, passed on head.

Scenario and synthetic seed

Not shown:

  • Real IME composition was not exercised: the scenario browser cannot drive a real input method, and synthetic composition events would be a stand-in.
  • The 1400×750 inline-panel control and reopening the base sheet to inspect its cleared query were not run; the paired proof covers the sheet-dismissal defect directly.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 23, 2026
@juliusmarminge
juliusmarminge merged commit 0fd87d3 into pingdotgg:main Nov 23, 2026
56 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants